# 条件判断

# >= <=  ==
# and or
# in
# True False
# if elif else
cars = ['audi', 'bmw', 'subaru', 'toyota']

for car in cars:
    if car == 'bmw':
        print(car.upper())
    else:
        print(car.title())

requested_topping = 'mushrooms'
if (requested_topping != 'anchovies'):
    print('Hold the achovies!')

# 检测多个条件 and
age_0 = 22
age_1 = 24
print(age_0 >= 21 and age_1 >= age_0)

# 检测多个条件 or
print(age_0 < 18 or age_1 > age_0)

# 检测特定值是否在列表中 in
print('in 操作符：','audi' in cars)

# 检测特定值是否不在列表中 not in
print('in 操作符：','audi' not in cars)

# 布尔值
game_active = True
can_edit = False

# if elif else
age = 12
if age < 4:
    print('your admission cost is $0.')
elif age < 18:
    print('your admission cost is $5.')
else:
    print('your admission cost is $10.')

requested_toppings = []
if requested_toppings:
    for requested_topping in requested_toppings:
        print('Adding ' + requested_topping + '.')
    print('\nFinished makinig your pizzza!')
else:
    print('Are you sure you want a plain pizza?')

for value in list(range(1, 10)):
    if (value == 1):
        print('1st')
    elif (value == 2):
        print('2nd')
    elif (value == 3):
        print('3rd')
    else:
        print(str(value) + 'th')

